/**
 * @author antonio081014
 * @date Sep 3, 2011
 * @time 8:41:35 AM
 */

public class RotatedClock
{
	public String getEarliest(int hourHand, int minuteHand) {
		for (int start = 0; start < 360; start += 30) {
			int hour = (start + hourHand) % 360;
			int minute = (hour * 12) % 360;
			if (minute == (start + minuteHand) % 360) {
				hour /= 30;
				minute /= 6;
				return String.format("%02d:%02d", hour, minute);
			}
		}
		return "";
	}
	
	
}
//Powered by [KawigiEdit] 2.0!
